<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib uri="/WEB-INF/tlds/att.tld" prefix="att"%>
<html>

<head> 
<meta name="decorator" content="moduleView"/> 
<script type="text/javascript" src="${staticPath}/js/decimalinput.js"></script>
<link href="${staticPath}/lib/chosen/1.1.0/chosen.min.css" rel="stylesheet" type="text/css">
<script src="${staticPath}/lib/chosen/1.1.0/chosen.jquery.js" type="text/javascript"></script>
<script src="${staticPath}/js/ossp-jquery-chosen.js" type="text/javascript"></script>
<script type="text/javascript">

function insertToContract(){
	//如果是新签或续签，且不是变更合同，不需要版本变更
	if($("#isModifyContract").val() =="" ){
		if($("#intentType").val() =="20" || $("#intentType").val() =="30"){
			var id = "${intAssociated.id}";
			var navId = "${navId}";
			Oosp_Loading('正在导入到合同，请稍等...');
			$.get("${contextPath}/biz/intent/intAdvertociated/"+id+"/insertToContract?navId="+navId,function(data){
				var obj = eval('(' + data + ')');
				if(obj.success){
					top.$.jBox.tip('导入到合同成功，请进入合同查看页面查看！', 'success');
					$("#insertToContract").hide();
				}else{
					top.$.jBox.tip('导入到合同失败！');
				
				}
			});
		  }
		
	}else if($("#isModifyContract").val() =="1"  || $("#intentType").val()=="40"){
		//如果是变更合同，要修改版本
		var url = '${contextPath}/${associated.versionUrl}${associated.mainId}/${associated.versionId}/${associated.assistId}/getMainVersion?contractAttribute=70&intAssociatedId=${intAssociated.id}&navId=${navId}';
		  $("#myModal").load(url,function(){  
			    $("#myModal").modal("show"); 
		  }); 
	}
}

//
function getTemplate(){
	  var navId = "${navId}"
      var url = '${contextPath}/biz/intent/common/getTemplate?navId='+navId;
      alert(url);
     $("#modifyModal").load(url,function (){
		 
		 $("#modifyModal").modal("show");
	 });
}

function sendSap(){
	$.getJSON(Com_Parameter.ContextPath + "/biz/intent/intAssociated/${intAssociated.id}/sendToSap?s_bean=iBrandPotsionSapService&status=20", function(data) {
		top.$.jBox.tip(data,'warning');
	});
}
function addSalesNo(){
	if($("#intentType").attr("value") =="20"){
		$("#addSalesNo").attr("href","${contextPath}/biz/intent/intSalesno/${intAssociated.id}/add?navId=${navId}");
	}else{
		top.$.jBox.tip('只有新签意向才能提报先申号！','warning');
	}
}
</script>
<script type="text/javascript">
var num = '${fn:length(intAssociated.intAssbrandsList)}';
var num_items='${fn:length(intAssociated.intAssitemsList)}';
var num_base='${fn:length(intAssociated.intAssbaseitemsList)}';
var storeId1 ='${intAssociated.storeId}'
var floorId1 ='${intAssociated.floorId}'
var  formart ="${intAssociated.formatId}"
var taxTypeCode ="${intAssociated.taxTypeCode}"
var taxRateCode ='${intAssociated.taxRateCode}'
</script>
<script type="text/javascript" src="${staticPath}/js/intAssociated.js"></script>
<script src="${staticPath}/js/jQuery.FillOptions.js"></script>
<link rel="stylesheet" href="${staticPath}/lib/ztree/3.5/css/zTreeStyle/zTreeStyle.css" type="text/css">
<script src="${staticPath}/js/jquery-dialog.js" type="text/javascript"></script>
<script src="${staticPath}/lib/ztree/3.5/js/jquery.ztree.all-3.5.js" type="text/javascript"></script>
<style type="text/css">
#barndModal .modal-dialog  {width:60%;}
#intAssitems .modal-dialog  {width:70%;}
#assbasemodal .modal-dialog  {width:60%;}
#terminateDateModal .modal-dialog  {width:30%;}
.texthidden{ width:190px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
</style>
</head>
<body>
	<div class="Report_f">
		<div class="Report_f_1">
				  <div class="Report_f_title_1">
					广告<c:if test="${intAssociated.isModifyContract =='1'}">变更</c:if><c:if test="${intAssociated.isModifyContract !='1'}"><ossp:value dictType="CONTRATC_ATTRIBUTE" key="${intAssociated.intentType}"></ossp:value></c:if>意向
					<c:if test="${not empty associated.id && userType != 'SUPPLIER'}">
					<a class="btn btn-info btn_3 btn_right"  href="${contextPath}/biz/contract/advertassociated/${associated.id}/view?navId=${navId}" target="_blank">原合同</a>
					</c:if>
				</div>
			<input type="hidden" id='intent_type' value="intAdvertociated">
			<input type="hidden" id="intentType" value="${intAssociated.intentType}">
			<input type="hidden" id="id" value="${intAssociated.id}">
			<input type="hidden" id="navId" value="${navId}">
			<input id="storeId" value="${intAssociated.storeId}" type="hidden"/> 
		   <ul class="nav nav-tabs Report_f_title_2" id="myTab">
			  <li class="active"><a href="#home" data-toggle="tab">基本信息</a></li>
			  <li><a href="#contractBrand_tab"  data-toggle="tab" >品牌信息</a></li> 
			  <li><a href="#contractCommnWhere_tab"  data-toggle="tab"  >合同条款</a></li> 
			 <li><a href="#IntAttachment" data-toggle="tab">合同附件</a></li> 
			  <c:if test="${userType !='SUPPLIER'}">
			 		 <li><a href="#workflow" data-toggle="tab">流程审批 </a></li> 
			  		<li><a href="#diagram" data-toggle="tab">流程图</a></li>
			  </c:if>
			 </ul> 
			<div class="tab-content Report_f_title_3">
			<tags:message content="${message}"/>
			  <div class="tab-pane active" id="home">
				  	  <div class="Report_f_title_4">
									<input id="contractArea" type="hidden"/> 
									<input id="salesVolume" type="hidden"/> 
									<input id="benefit" type="hidden"/> 
									<input id="areaCoefficient" type="hidden"/> 
									<div style="display: none">
										<select id="taxRateCode_select"></select>
									</div>
									<div class="f_2">
								<div class="form-group col-sm-5">
								<label for="inputtext3" class="col-sm-5	 f_4">意向单号:</label>
								<div class="col-sm-5 f_7">
									${intAssociated.intentNo}
								</div>
							</div>
							<div class="form-group col-sm-5">
								<label for="inputtext3" class="col-sm-5 f_4">意向名称:</label>
									<div class="col-sm-5 f_7">
										${intAssociated.subject}
									</div>
							</div>
						</div>
						<div class="f_3">
								<div class="form-group col-sm-5">
								<label for="inputtext3" class="col-sm-5	 f_4">意向状态:</label>
								<div class="col-sm-5 f_7">
									<ossp:value dictType="INTENT_STATUS" key="${intAssociated.status}"></ossp:value>
								</div>
							</div>
							<div class="form-group col-sm-5">
								<label for="inputtext3" class="col-sm-5 f_4">意向类型:</label>
									<div class="col-sm-5 f_7">
										<ossp:value dictType="CONTRATC_ATTRIBUTE" key="${intAssociated.intentType}"></ossp:value>
									</div>
							</div>
						</div>
						<div class="f_2">
							<div class="form-group col-sm-5">
								<label for="inputtext3" class="col-sm-5 f_4">是否符合标准:</label>
									<div class="col-sm-5 f_7">
										<ossp:value dictType="YESORNO" key="${intAssociated.isUpToStandard}"></ossp:value>
									</div>
							</div>
							<div class="form-group col-sm-5">
								<label for="inputtext3" class="col-sm-5	 f_4">合同签订人:</label>
								<div class="col-sm-5 f_7">
									${intAssociated.signBy}
								</div>
							</div>
						</div>
						<div class="f_2">
							<div class="form-group col-sm-5">
								<label for="inputtext3" class="col-sm-5 f_4">合同开始时间:</label>
									<div class="col-sm-5 f_7">
										<fmt:formatDate  value="${intAssociated.startDate}" pattern="yyyy-MM-dd"/>
									</div>
							</div>
							<div class="form-group col-sm-5">
								<label for="inputtext3" class="col-sm-5	 f_4">合同结束时间:</label>
								<div class="col-sm-5 f_7">
									<fmt:formatDate  value="${intAssociated.endDate}" pattern="yyyy-MM-dd"/>
								</div>
							</div>
						</div>
						<div class="f_2">
							<div class="form-group col-sm-5">
							<label for="inputtext3" class="col-sm-5	 f_4">区域:</label>
								<div class="col-sm-5 f_7">
									${intAssociated.area}
								</div>
							</div>
							<div class="form-group col-sm-5">
								<label for="inputtext3" class="col-sm-5 f_4">门店:</label>
									<div class="col-sm-5 f_7">
										${intAssociated.store}
									</div>
							</div>
							
						</div>
						<div class="f_3">
							<div class="form-group col-sm-5">
							<label for="inputtext3" class="col-sm-5	 f_4">楼层:</label>
								<div class="col-sm-5 f_7">
									${intAssociated.floor}
								</div>
							</div>
							<div class="form-group col-sm-5">
								<label for="inputtext3" class="col-sm-5 f_4">铺位:</label>
									<div class="col-sm-5 f_7">
										${shopName}
									</div>
							</div>
						</div>
						<div class="f_2">
							<div class="form-group col-sm-5">
							<label for="inputtext3" class="col-sm-5	 f_4">主合同号:</label>
								<div class="col-sm-5 f_7">
									${intAssociated.mainContractNo}
								</div>
							</div>
							<div class="form-group col-sm-5">
							<label for="inputtext3" class="col-sm-5	 f_4">签约主体:</label>
								<div class="col-sm-5 f_7">
									${intAssociated.signBody}
								</div>
							</div>
						</div>
						<div class="f_3">
							<div class="form-group col-sm-5">
								<label for="inputtext3" class="col-sm-5 f_4">供应商编码:</label>
									<div class="col-sm-5 f_7">
									<input type="hidden" id="supplierNo" value="${intAssociated.supplierNo}">
										${intAssociated.supplierNo}
									</div>
							</div>
							<div class="form-group col-sm-5">
							<label for="inputtext3" class="col-sm-5	 f_4">供应商名称:</label>
								<div class="col-sm-5 f_7">
									${intAssociated.supplierName}
								</div>
							</div>
						</div>
						<div class="f_2">
							<div class="form-group col-sm-5">
							<label for="inputtext3" class="col-sm-5	 f_4">是否变更合同:</label>
								<div class="col-sm-5 f_7">
									<input type="hidden" id="isModifyContract" value="${intAssociated.isModifyContract}">
									<ossp:value dictType="YESORNO" key="${intAssociated.isModifyContract}"></ossp:value>
								</div>
							</div>
							<c:if test="${intAssociated.isModifyContract =='1'}">
								<div class="form-group col-sm-5">
								<label for="inputtext3" class="col-sm-5	 f_4">变更后生效日期:</label>
									<div class="col-sm-5 f_7">
										<fmt:formatDate  value="${intAssociated.effectDate}" pattern="yyyy-MM-dd"/>
									</div>
								</div>
							</c:if>
						</div>
							
							<div class="f_2">  
								<div class="form-group col-sm-5">
								<label for="inputtext3" class="col-sm-5	 f_4">供应商是否同意合作:</label>
								<div class="col-sm-5 f_7">
									<c:if test="${empty intAssociated.supplierConfirm}">
										供应商未处理
									</c:if>
									<c:if test="${!empty intAssociated.supplierConfirm}">
										<ossp:value dictType="SUPPLIER_AGREE" key="${intAssociated.supplierConfirm}"></ossp:value>
									</c:if>
									
								</div>
							</div>
						 	   <div class="form-group col-sm-5">
									<label for="inputtext3" class="col-sm-5 control-label f_4">涉及条款修改:</label>
									<div class="col-sm-5 f_7">
										<ossp:value dictType="isEditItems" key="${intAssociated.isEditItems}"></ossp:value>
									</div>
								</div>
								
					     	</div>
					     	<div class="f_2">
							<div class="form-group col-sm-5">
								<label for="recieveStatus_lab" class="col-sm-5 f_4">合文本开始日期:</label>
								<div class="col-sm-5 f_7">
										<fmt:formatDate value="${intAssociated.textStartDate}" pattern="yyyy-MM-dd"/> 
								</div>
							</div>
							<div class="form-group col-sm-5">
								<label for="inputtext3" class="col-sm-5	 control-label f_4">文本结束日期:</label>
								<div class="col-sm-5 f_7">
									<fmt:formatDate value="${intAssociated.textEndDate}" pattern="yyyy-MM-dd"/> 
								</div>
							</div>
						</div>
					     	<div class="f_3">
					     		<div class="form-group col-sm-5">
									<label for="inputtext3" class="col-sm-5	 f_4">是否已生成合同文本:</label>
									<div class="col-sm-5 f_7">
										<ossp:value dictType="isContractModify" key="${intAssociated.isContractModify}"></ossp:value>
									</div>
								</div>
								<div class="form-group col-sm-5">
									<label for="inputtext3" class="col-sm-5	 f_4">业态:</label>
									<div class="col-sm-5 f_7">
										${format.name}
									</div>
								</div>
					     </div>
					     <div class="f_2">
					      	<div class="form-group col-sm-8">
									<label for="inputtext3" class="col-sm-3 control-label f_4">涉及条件/位置变化:</label>
									<div class="col-sm-6 f_7">
										<ossp:value dictType="isCahAdd" key="${intAssociated.isCahAdd}"></ossp:value>
									</div>
								</div>
						</div>
						<div class="f_3">
								<div class="form-group col-sm-6">
											<label for="inputtext3" class="col-sm-3 control-label f_4">其他约定事项:</label>
											<div class="col-sm-5 f_7">
												<textarea rows="5" cols="110" name="otherItems" readonly="readonly" id="otherItems" class="form">${intAssociated.otherItems}</textarea>
											</div>
									</div>
						</div>
						<div class="f_2">
								<div class="form-group col-sm-6">
											<label for="inputtext3" class="col-sm-3 control-label f_4">签约原因分析:</label>
											<div class="col-sm-5 f_7">
												<textarea rows="5" cols="110" name="signReasons" id="signReasons" readonly="readonly" class="form">${intAssociated.signReasons}</textarea>
											</div>
									</div>
							</div>
						<div class="f_3">
						<div class="form-group col-sm-5">
							<label for="createTime_lab" class="col-sm-5 f_4">提报人:</label>
							<div class="col-sm-5 f_7">
								${intAssociated.createBy}
	                		</div>
						</div>
						<div class="form-group col-sm-5">
							<label for="createTime_lab" class="col-sm-5 f_4">提报时间:</label>
							<div class="col-sm-5 f_7">
								<fmt:formatDate value="${intAssociated.createTime}" type="both" pattern="yyyy-MM-dd HH:mm:ss"/>
	                		</div>
						</div>
				  </div>
				  <div class="f_2">
						<div class="form-group col-sm-5">
							<label for="createTime_lab" class="col-sm-5 f_4">最后修改人:</label>
							<div class="col-sm-5 f_7">
								${intAssociated.updateBy}
	                		</div>
						</div>
						<div class="form-group col-sm-5">
							<label for="createTime_lab" class="col-sm-5 f_4">最后修改时间:</label>
							<div class="col-sm-5 f_7">
								<fmt:formatDate value="${intAssociated.updateTime}" type="both" pattern="yyyy-MM-dd hh:mm:ss"/>
	                		</div>
						</div>
					</div>
				  </div>
				  <att:down key="contractText" soureBillID="${intAssociated.id}"  isShowDel="${isShowDel}"   modleName="com.maoye.ossp.biz.intent.entity.IntCreatePdfEntity"></att:down>
				 </div>
				 
				  <div class="tab-pane" id="contractBrand_tab">
			  		 <div> 
							<table class="table table-striped table-hover o-l-table" id="table1">
								<thead>
										<tr>
											<th>中文名称</th> 
											<th>英文文名称</th> 
										    <th>招商分类</th>
										    <th>品牌责任人</th>
										    <th>商铺</th>
										</tr>
								</thead>
								<tbody id="tableBrand">
									<c:forEach items="${intAssociated.intAssbrandsList}" var="brand" varStatus="i">
										<tr onclick="edit_brand(this,${i.index})" data-herf="" data-target="_self">
											<td  >
									<input style="display: none" name="assbrandBox" type="checkbox" value="${i.index }"/>
											<input type="hidden" id="intAssbrand_id${i.index }" name="intAssbrandsList[${i.index }].id" value="${brand.id}"/>
											<input type="hidden" id="brandId${i.index }" name="intAssbrandsList[${i.index }].brandId"  value="${brand.brandId}"/>
											<input type="hidden" id="brandCName${i.index }" name="intAssbrandsList[${i.index }].brandCName"  value="${brand.brandCName}" />
											<input type="hidden" id="brandEName${i.index }" name="intAssbrandsList[${i.index }].brandEName"  value="${brand.brandEName}" />
											<input type="hidden" id="brandLevel${i.index }" name="intAssbrandsList[${i.index }].brandLevel"  value="${brand.brandLevel}"  />
											<input type="hidden" id="brandAttribute${i.index }" name="intAssbrandsList[${i.index }].brandAttribute"  value="${brand.brandAttribute}"  />
											<input type="hidden" id="commodityCate${i.index }" name="intAssbrandsList[${i.index }].commodityCate"  value="${brand.commodityCate}" />
											<input type="hidden" id="inviteCate${i.index }" name="intAssbrandsList[${i.index }].inviteCate"  value="${brand.inviteCate}" />
											<input type="hidden" id="brandInviteHead${i.index }" name="intAssbrandsList[${i.index }].brandInviteHead"  value="${brand.brandInviteHead}" />
											<input type="hidden" id="memberRateType${i.index}" name="intAssbrandsList[${i.index }].memberRateType"  value="${brand.memberRateType}" />
											<input type="hidden" id="gcardDiscount${i.index}" name="intAssbrandsList[${i.index }].gcardDiscount"  value="${brand.gcardDiscount}" />
											<input type="hidden" id="gcardDiscount2${i.index}" name="intAssbrandsList[${i.index }].gcardDiscount2"  value="${brand.gcardDiscount2}" />
											<input type="hidden" id="ocardDiscount${i.index}" name="intAssbrandsList[${i.index }].ocardDiscount"  value="${brand.ocardDiscount}" />
											<input type="hidden" id="ocardDiscount2${i.index}" name="intAssbrandsList[${i.index }].ocardDiscount2"  value="${brand.ocardDiscount2}" /> 
											<input type="hidden" id="isMainBrand${i.index}" name="intAssbrandsList[${i.index }].isMainBrand"  value="${brand.isMainBrand}" /> 
											<input type="hidden" id="purchasingGroup${i.index}" name="intAssbrandsList[${i.index }].purchasingGroup"  value="${brand.purchasingGroup}" /> 
											<input type="hidden" id="intAssShopIds${i.index}" name="intAssbrandsList[${i.index}].intAssShopIds" value="<c:forEach items="${brand.intAssbsh}" var="assbsh" varStatus="j">${assbsh.shop.shopId},</c:forEach>" />
											<input type="hidden" id="intAssShopNames${i.index}" name="intAssbrandsList[${i.index}].intAssShopNames" value="<c:forEach items="${brand.intAssbsh}" var="assbsh" varStatus="j">${assbsh.shop.shop},</c:forEach>" />
												${brand.brandCName}
											</td>
											<td>${brand.brandEName}</td>
											<td>${brand.cmcate.cateName}</td>
											<td>${brand.brandInviteHead}</td>
											<td>
											<c:forEach items="${brand.intAssbsh}" var="sh" varStatus="j">
												${sh.shop.shop}
												<c:if test="${fn:length(brand.intAssbsh)}!=${j.index}">
												,
												</c:if>
														
												</c:forEach>
											</td>
										
										</tr>
						           </c:forEach>
								</tbody>
							</table>
					 </div>
				 </div>
				 
				 
				<div class="tab-pane" id="contractCommnWhere_tab">
			
			  		 <div> 
							<table class="table table-striped table-hover o-l-table" id="table1">
								<thead>
										<tr>
											<th>扣款代码</th>
											<th>扣款项</th>
										    <th>金额/比例</th>
										    <th >开始日期</th>
										    <th >结束日期</th>
										    <th>扣款时效类型</th>
										    <th>计算基数</th>
										    <th>税率</th>
										</tr>
								</thead>
								<tbody id="contractCommnWhere">
								<c:forEach items="${intAssociated.intAssitemsList}" var="assitems" varStatus="i">
										<tr onclick="edit_items(this,${i.index })" data-herf="" data-target="_self">
											<td >
												<input type="checkbox" style="display: none"  name="assitemsBox" value="${i.index }" />
												<input type="hidden" id="intAssitems_id${i.index}"  value="${assitems.id}"/>
												<input type="hidden" id="deductItem_items${i.index}" name="intAssitemsList[${i.index}].deductItem" value="${assitems.deductItem}"/>
												<input type="hidden" id="deductCate_items${i.index}" name="intAssitemsList[${i.index}].deductCate" value="${assitems.deductCate}" />
												<input type="hidden" id="amount_items${i.index}" name="intAssitemsList[${i.index}].amount" value="<fmt:formatNumber value="${assitems.amount}" pattern="#00.00#"/>"  />
												<input type="hidden" id="startDate_items${i.index}"  name="intAssitemsList[${i.index}].startDate" value="<fmt:formatDate value="${assitems.startDate}" pattern="yyyy-MM-dd"/>"  />
												<input type="hidden" id="endDate_items${i.index}"  name="intAssitemsList[${i.index}].endDate" value="<fmt:formatDate value="${assitems.endDate}" pattern="yyyy-MM-dd"/>"  />
												<input type="hidden" id="validType_items${i.index }" name="intAssitemsList[${i.index}].validType" value="${assitems.validType}" class="form-control "/>
												<input type="hidden" id="countBase_items${i.index }" name="intAssitemsList[${i.index}].countBase" value="${assitems.countBase}" class="form-control "/>
												<input type="hidden" id="deductType_items${i.index }" name="intAssitemsList[${i.index}].deductType" value="${assitems.deductType}" class="form-control "/>
												<input type="hidden" id="deductCode_items${i.index }" name="intAssitemsList[${i.index}].deductCode" value="${assitems.deductCode}" class="form-control "/>
												<input type="hidden" id="taxRate_items${i.index }" name="intAssitemsList[${i.index}].taxRate" value="${assitems.taxRate}" class="form-control "/>
												<input type="hidden" id="remarks_items${i.index }" name="intAssitemsList[${i.index}].remarks" value="${assitems.remarks}" class="form-control "/>
											${assitems.deductCode}</td>
											<td>${assitems.deductItem}</td>
											<td ><fmt:formatNumber value="${assitems.amount}" pattern="#00.00#"/>
											<c:if test="${fn:startsWith(assitems.deductCode, 'A')}">%</c:if></td>
											<td ><fmt:formatDate value="${assitems.startDate}" pattern="yyyy-MM-dd"/></td>
											<td ><fmt:formatDate value="${assitems.endDate}" pattern="yyyy-MM-dd"/></td>
											<td ><ossp:value dictType="DEFEND_SYTLE" key="${assitems.validType}"/></td> 
											<td ><c:if test="${not empty assitems.countBase}"><ossp:value dictType="COMPUTE_BASE" key="${assitems.countBase}"/></c:if></td> 
											<td >${assitems.baseRate.taxRateRemark}</td> 
										</tr>
						           </c:forEach>
								</tbody>
							</table>
					 </div>
				 </div>
				<div class="tab-pane" id="IntAttachment"> 
							<div>
									<table class="table table-striped table-hover o-l-table" id="IntAttTable">
										<thead>
											<tr>
												<th>附件名称</th>
												<c:if test="${userType !='SUPPLIER'}">
												<th>供应是否提供</th>
												</c:if>
											</tr>
										</thead>
										<tbody id="tableBrand">
											<c:forEach items="${intAssociated.attList}" var="attContract" varStatus="i">
												<tr>
													<td class="o-l-tab-ckb">
														${attContract.att.name}
													</td>
													<c:if test="${userType !='SUPPLIER'}">
													<td class="o-l-tab-ckb">
														<input type="checkbox" onclick="changChecked(${i.index},'view','${attContract.id}')"  name="attList[${i.index}].isContrfim" id="attList${i.index}isContrfim"  <c:if test="${attContract.isContrfim=='1'}">checked="checked"</c:if> value="${attContract.isContrfim}">
													</td>
													</c:if>
												<%-- 	<td class="o-l-tab-ckb">
														<a href="#"onclick="remove_Att(this,'${i.index}')">删除</a>
													</td> --%>
												</tr>
											</c:forEach>
										</tbody>
									</table>
								</div>
				</div>
			 
			 
			 	<div class="tab-pane" id="workflow"> 
						<c:import url="/WEB-INF/views/bpm/workflow/workFlowInfo_view.jsp">
							<c:param name="formName" value="com.maoye.ossp.biz.intent.entity.IntAssociated" />
							<c:param name="flowKey" value="ZCHTXQ" />
							<c:param name="businessId" value="${intAssociated.id}"/>
							<c:param name="method" value="${method}"/>
							<c:param name="isStart" value="${isStart}"/>
						</c:import> 			
					</div>
				<div class="tab-pane" id="diagram" style="overflow-x:auto;">
					<iframe id="diagram_iframe" scrolling="yes" frameborder=0 width="100%">
					</iframe>
				</div>
			 <div class="tab-pane" id="contract_hist">
			 	<iframe id="versionFrame"   name="versionFrame"  
												scrolling="no" frameborder="no" width="100%"></iframe>
			 </div>	


			</div> 
	  			<div class="o-l-action">
	  				<c:if test="${userType =='SUPPLIER'}">
		  			  	<c:if test="${intAssociated.supplierConfirm !='1'}">
		  			  		<shiro:hasPermission name="com.maoye.ossp.biz.contract.intent.Common:SupplierConfirm">
		  			  		<a class="btn btn-danger btn_3 pull-right"  href="javascript:void" id="unagree" onclick="supplierUnagree()">不同意</a>
		  			  		<a class="btn btn-success btn_3 pull-right"  href="javascript:void" id="agree" onclick="supplierAgree()">同意</a>
		  			  		</shiro:hasPermission>
		  			  	</c:if>	
	  			  	</c:if>
		  			  <c:if test="${userType !='SUPPLIER'}">
						<a class="btn btn-default btn_3 pull-right"  href="${contextPath}/biz/intent/intAdvertociated/list?navId=${navId}&pageNo=${pageNo}" >返回</a>
						<c:if test="${intAssociated.status != '04'}">
						<div id="hidden">
						
							<c:if test="${intAssociated.isCreateContract == '0'}">
								<shiro:hasPermission name="com.maoye.ossp.biz.contract.intent.Common:CloseIntent">
									<a class="btn btn-danger btn_3 pull-right"  href="javascript:void(0)" onclick="closeIntent()" >终止</a>
								</shiro:hasPermission>
							</c:if>
						<c:if test="${intAssociated.status == '00'}">
						<shiro:hasPermission name="com.maoye.ossp.biz.contract.intent.IntAdvertociated:update">
						 <a class="btn btn-default btn_3 pull-right"  href="${contextPath}/biz/intent/intAdvertociated/${intAssociated.id}/edit?navId=${navId}" >修改</a>
						</shiro:hasPermission></c:if>
						<c:if test="${intAssociated.status == '02'}">
							<!--  -->
							<c:if test="${intAssociated.intentType == '20' && intAssociated.isContractModify != '1'}">
								<shiro:hasPermission name="com.maoye.ossp.biz.contract.intent.IntSalesno:add">
								<a class="btn btn-info btn_3 pull-right"  id="addSalesNo"  onclick="addSalesNo()" >申请先申号</a>
								</shiro:hasPermission>
							</c:if>
							<shiro:hasPermission name="com.maoye.ossp.biz.contract.intent.Common:CreateText">
							<a class="btn btn-info btn_3 btn_right"  href="javascript:void(0)" onclick="getTemplate()">生成协议文本</a></shiro:hasPermission> 
					    	<!-- 如果已经生成协议文本，才可以导入到合同，导入之后不能再次导入 -->
					    	<c:if test="${intAssociated.isContractModify == 1}">
					    		<c:if test="${intAssociated.isCreateContract == 0 &&intAssociated.supplierConfirm==1}">
					    			<shiro:hasPermission name="com.maoye.ossp.biz.contract.intent.IntAdvertociated:insertToContract">
					    			<a class="btn btn-info btn_3 btn_right"  id="insertToContract" onclick="insertToContract()">导入到合同</a></shiro:hasPermission>
					    		</c:if>
					    		<c:if test="${intAssociated.isCreateContract == 1}">
						    			<shiro:hasPermission name="com.maoye.ossp.biz.contract.manage.AdvertAssociated:select">
		  			 						<a class="btn btn-info btn_3 btn_right"  id="contractView" onclick="contractView()">查看已生成合同</a>
		  			 					</shiro:hasPermission>
		  							</c:if>
	  								<c:if test="${intAssociated.supplierConfirm!=1}">
							    		<shiro:hasPermission name="com.maoye.ossp.biz.contract.intent.Common:sendMessage">
							    			<a class="btn btn-info btn_3 btn_right"   href="javascript:void(0)" onclick="sendMessageToSupplier('${intAssociated.id}','${navId}','${intAssociated.intentType}')">通知供应商下载合同</a>
							    		</shiro:hasPermission>
				    				</c:if>
					    		
					    	</c:if>
					    	<shiro:hasPermission name="com.maoye.ossp.biz.contract.intent.Common:sendToSap">
					    		<a class="btn btn-info btn_3 btn_right" type="button"  onclick="sendSap()"  >发送SAP</a>
					    	</shiro:hasPermission>
				    	</c:if>
				    	</div>
				    	</c:if>
			    		<c:if test="${intAssociated.supplierConfirm =='0'}">
			    			<shiro:hasPermission name="com.maoye.ossp.biz.contract.intent.Common:Feedback">
			  			 		<a class="btn btn-success btn_3 pull-right"  href="${contextPath}/biz/intent/common/${intAssociated.id}/addFeedback?navId=${navId}" >重新洽谈</a>
			  			 	</shiro:hasPermission>
			  			 </c:if> 
			    	</c:if>
				</div>
				
		
		</div>
		<!-- Modal -->
	<div class="modal fade" id="terminateDateModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div> 
	<!-- Modal -->
	<div class="modal fade" id="modifyModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div> 
	<!-- Modal -->
	<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div> 
<!-- Modal -->
	<div class="modal fade" id="supplierModal" style="width:800" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div> 
	<div class="modal fade" id="barndModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div> 		
	<div class="modal fade" id="intAssitems"  tabindex="-1"  style="display: none;"></div> 
	<div class="modal fade" id="assbasemodal"  tabindex="-1"  style="display: none;"></div> 	
	</div>	
	<script type="text/javascript">
	$('.form_date').datetimepicker({
        language:  'zh-CN',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 0,
		todayHighlight: 1,
		startView: 2,
		minView: 2,
		forceParse: 0,
		format: 'yyyy-mm-dd'
		
    });


</script>
</body>

</html>